#!/usr/bin/perl -w

# outl
# File ID: e9ab7e9e-5d41-11df-92c4-90e6ba3022ac
# Lager en outline over HTML-dokumenter.

use strict;

while(<>) {
    if (/<h([1-6]).*?>(.*)<\/h[1-6]>/i) {
        my ($Cnt, $Txt) = ($1, $2);
        while($Cnt--) {
            print("\t");
        }
        $Txt =~ s/<a name=.+?>//g;
        $Txt =~ s/<\/a>//g;
        $Txt =~ s/^\s+//;
        $Txt =~ s/\s+$//;
        print "$Txt\n";
    }
}
